cmake_minimum_required(VERSION 3.22)
project(xitong_shaokao C)

set(CMAKE_C_STANDARD 99)

include_directories(${PROJECT_SOURCE_DIR}/include)

#add_executable(xitong_shaokao src/main.c src/sqlite3.c)
# 关键：批量匹配 src 目录下所有 .c 文件，存入变量 SRC_FILES
# file(GLOB 变量名 "路径匹配规则")：按指定规则匹配文件，将文件路径列表存入变量；
file(GLOB SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c")
# 用变量代替逐个文件，生成可执行文件

add_executable(xitong_shaokao ${SRC_FILES} src/database.c include/database.h src/admin.c include/admin.h include/user.h include/admin_login.h src/user_insert.c src/main.c src/stock_insert.c src/VIP_insert.c include/VIP_insert.h include/stock.h src/zyy_zsgc/admin_zsgc.c  src/zyy_zsgc/login_register.c src/zyy_zsgc/user_login_register.c)